home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / infoserv / www / cern / doc / www-talk.archive.Z / www-talk.archive / text0097.txt < prev    next >
Encoding:
Text File  |  1992-11-30  |  996 b   |  36 lines

  1. >        All you do is map the parameters of the virtual search engine
  2. >        onto a document name -- like
  3. >
  4. >        /INDEX/full-text/tryhard/depth=5/boolean
  5. >
  6. > Does this mean (at a primitive level) you could code a grep command
  7. > as a document name?
  8. >
  9.     Yes -- sure.  Its a question of writing down the
  10.     algorithm. In perl, I'm sure its a cinch ... you could
  11.     also do it with sh and sed :-( but basically for example
  12.     you need to take say
  13.  
  14.     /grep/mydir/i?joe+bloggs
  15.  
  16.     and turn that into
  17.  
  18.     grep -l -i "(joe)|(bloggs)" | awk -f ls2html.awk
  19.  
  20. where ls2html.awk looks something like:
  21.  
  22.     BEGIN {  print "Select one of:\n<MENU>" }
  23.     { printf "<LI><A HREF=./%s>   %s</A>\n", $1, $1 }
  24.     END { print "</MENU>" }
  25.  
  26. The awk generates the HTML for a menu.  I guess you could use awk in fact to  
  27. generate the grep command too.  But these are just ideas.  or are you using VMS?  
  28. Yes, you could probably do it with DCL and SEARCH.
  29.  
  30. Of course if you can handle C, then hack the sample httpd.
  31.  
  32. > ///Peter
  33.  
  34.     Tim
  35.  
  36.